# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-django-nested-admin
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=django-nested-admin
pkgver=4.0.2
pkgrel=1
pkgdesc="Django admin classes that allow for nested inlines"
url="https://pypi.org/project/django-nested-admin"
arch="noarch"
license="BSD"
depends="py3-python-monkey-business"
checkdepends="
	py3-pytest
	py3-pytest-cov
	py3-pytest-xdist
	py3-pytest-django
	py3-pillow
	py3-dj-database-url
	py3-django-selenosis
	py3-selenium
	"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="$pkgname-$pkgver.tar.gz::https://github.com/theatlantic/django-nested-admin/archive/refs/tags/v$pkgver.tar.gz"
options="!check" # missing py3-selenium and py3-django-selenosis
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	cd "$builddir"/nested_admin
	DJANGO_SETTINGS_MODULE=tests.settings "$builddir"/.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
84fda9b11c13de85f75c5b0a5bb74e90cd6e9df3c0ac8a7897765ab45f74bd8c749283b10abc486cf5ed08e2ca6e2d06bb16ac26519051aee39b162dde6c7701  py3-django-nested-admin-4.0.2.tar.gz
"
